import axios from '@/api/fetch';
//import * as types from './types';
import SERVER from '@/api/server';


//新增的保存
export const newSave = params => axios.post(`${SERVER.CLAIMFAC}/rPModelLabour/saveOne`,  params );

//分页查询
export const getListByPage = params => axios.post(`${SERVER.CLAIMFAC}/rPModelLabour/getListByPage`,  params );

//编辑弹窗的保存
export const editSave = params => axios.post(`${SERVER.CLAIMFAC}/rPModelLabour/updateByMlId`,  params );

//编辑反显
  export const selectById = params =>
  axios.get(`${SERVER.CLAIMFAC}/rPModelLabour/selectById`, {
    params
  });
//主页面的单条删除
export const deleteOne = data => axios.post(`${SERVER.CLAIMFAC}/rPModelLabour/updateStatusById`,  null ,{params : data} );  
//批量启动
export const piliangqiyong = data => axios.post(`${SERVER.CLAIMFAC}/rPModelLabour/updateEnableByIds`,  null ,{params : data} );
//批量停用
export const piliangtingyong = data => axios.post(`${SERVER.CLAIMFAC}/rPModelLabour/updateEnableByIds`,  null ,{params : data} );
//导出
export const getListForExport = (params) => axios.post(`${SERVER.CLAIMFAC}/rPModelLabour/getListForExport`, params, {
    responseType: 'blob'
  });
  //下载中心导出
  export const exporturl = params => axios.post(`/api/cmscloud.excel/downloadExcel/exportExcel/${params.CODE}`, params);

//导出模版
export const downloadModel = params => {
  const url = `${SERVER.CLAIMFAC}/rPModelLabour/exportModel`;
  return axios({
    url,
    method: 'post',
    responseType: 'blob'
  });
};
